<template>
	<up-cell-group>
		<up-cell :title="user.username" :label="user.studentId" @click="cickLogin">

			<template #icon>
				<up-avatar :src="user.avartar"></up-avatar>
			</template>
			<template #right-icon>
				<up-icon name="arrow-right-double"></up-icon>
			</template>
		</up-cell>
		<up-cell icon="integral-fill" title="投诉" @click="sub"></up-cell>
		<up-cell icon="email-fill" title="邮箱" @click="subemail"></up-cell>
	</up-cell-group>
</template>

<script setup>
	
	import {
		ref, onMounted
	} from 'vue';
	
	const user = ref({
		username: '未登录',
		studentId: '11111',
		avartar: ''
	})
		
	const cickLogin=()=>{
		uni.redirectTo({
			url:'/pages/Login/login'
		})
	}
	const sus=()=>{
		 uni.navigateTo({
        url: '/compl/compl'
    });
		}

	const subemail=()=>{
		alert("")
	}
	onMounted(() => {
		const res = uni.getStorageSync('userInfo');
		const ress=res;
	        //如果没有值就采用默认的值
			user.value.name = ress.name;
			user.value.studentId = ress.studentId ;
			user.value.avartar = ress.avartar;
		})
</script>